class Solution(object):
    def rotate(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: void Do not return anything, modify nums in-place instead.
        """
        k = k % len(nums)
       
        while k > 0:
            last = nums.pop()
            nums.insert(0, last)
            k -= 1

        print(nums)

s = Solution()
print(s.rotate([1,2,3,4,5,6,7], 3))
print(s.rotate([-1,-100,3,99], 2))
